3.294 \(\int \cos ^2(e+f x) (a+b \sin ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=116 \[ \frac {\left (8 a^2+4 a b+b^2\right ) \sin (e+f x) \cos (e+f x)}{16 f}+\frac {1}{16} x \left (8 a^2+4 a b+b^2\right )-\frac {b (8 a+3 b) \sin (e+f x) \cos ^3(e+f x)}{24 f}-\frac {b \sin (e+f x) \cos ^5(e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 f} \]

[Out]

1/16*(8*a^2+4*a*b+b^2)*x+1/16*(8*a^2+4*a*b+b^2)*cos(f*x+e)*sin(f*x+e)/f-1/24*b*(8*a+3*b)*cos(f*x+e)^3*sin(f*x+
e)/f-1/6*b*cos(f*x+e)^5*sin(f*x+e)*(a+(a+b)*tan(f*x+e)^2)/f

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3191, 413, 385, 199, 203} \[ \frac {\left (8 a^2+4 a b+b^2\right ) \sin (e+f x) \cos (e+f x)}{16 f}+\frac {1}{16} x \left (8 a^2+4 a b+b^2\right )-\frac {b (8 a+3 b) \sin (e+f x) \cos ^3(e+f x)}{24 f}-\frac {b \sin (e+f x) \cos ^5(e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

((8*a^2 + 4*a*b + b^2)*x)/16 + ((8*a^2 + 4*a*b + b^2)*Cos[e + f*x]*Sin[e + f*x])/(16*f) - (b*(8*a + 3*b)*Cos[e
 + f*x]^3*Sin[e + f*x])/(24*f) - (b*Cos[e + f*x]^5*Sin[e + f*x]*(a + (a + b)*Tan[e + f*x]^2))/(6*f)

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[(x*(a + b*x^n)^(p + 1))/(a*n*(p + 1)), x] + Dist[(n*(p +
 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (In
tegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[p]
)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 413

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[((a*d - c*b)*x*(a + b*x^n)^
(p + 1)*(c + d*x^n)^(q - 1))/(a*b*n*(p + 1)), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 3191

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+(a+b) x^2\right )^2}{\left (1+x^2\right )^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {b \cos ^5(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{6 f}+\frac {\operatorname {Subst}\left (\int \frac {a (6 a+b)+3 (a+b) (2 a+b) x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{6 f}\\ &=-\frac {b (8 a+3 b) \cos ^3(e+f x) \sin (e+f x)}{24 f}-\frac {b \cos ^5(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{6 f}+\frac {\left (8 a^2+4 a b+b^2\right ) \operatorname {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac {\left (8 a^2+4 a b+b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b (8 a+3 b) \cos ^3(e+f x) \sin (e+f x)}{24 f}-\frac {b \cos ^5(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{6 f}+\frac {\left (8 a^2+4 a b+b^2\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{16 f}\\ &=\frac {1}{16} \left (8 a^2+4 a b+b^2\right ) x+\frac {\left (8 a^2+4 a b+b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b (8 a+3 b) \cos ^3(e+f x) \sin (e+f x)}{24 f}-\frac {b \cos ^5(e+f x) \sin (e+f x) \left (a+(a+b) \tan ^2(e+f x)\right )}{6 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.27, size = 79, normalized size = 0.68 \[ \frac {12 (b+(2-2 i) a) (b+(2+2 i) a) (e+f x)-3 b (4 a+b) \sin (4 (e+f x))+3 (4 a-b) (4 a+b) \sin (2 (e+f x))+b^2 \sin (6 (e+f x))}{192 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

(12*((2 - 2*I)*a + b)*((2 + 2*I)*a + b)*(e + f*x) + 3*(4*a - b)*(4*a + b)*Sin[2*(e + f*x)] - 3*b*(4*a + b)*Sin
[4*(e + f*x)] + b^2*Sin[6*(e + f*x)])/(192*f)

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 85, normalized size = 0.73 \[ \frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} f x + {\left (8 \, b^{2} \cos \left (f x + e\right )^{5} - 2 \, {\left (12 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/48*(3*(8*a^2 + 4*a*b + b^2)*f*x + (8*b^2*cos(f*x + e)^5 - 2*(12*a*b + 7*b^2)*cos(f*x + e)^3 + 3*(8*a^2 + 4*a
*b + b^2)*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

giac [A]  time = 0.18, size = 84, normalized size = 0.72 \[ \frac {1}{16} \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} x + \frac {b^{2} \sin \left (6 \, f x + 6 \, e\right )}{192 \, f} - \frac {{\left (4 \, a b + b^{2}\right )} \sin \left (4 \, f x + 4 \, e\right )}{64 \, f} + \frac {{\left (16 \, a^{2} - b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{64 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/16*(8*a^2 + 4*a*b + b^2)*x + 1/192*b^2*sin(6*f*x + 6*e)/f - 1/64*(4*a*b + b^2)*sin(4*f*x + 4*e)/f + 1/64*(16
*a^2 - b^2)*sin(2*f*x + 2*e)/f

________________________________________________________________________________________

maple [A]  time = 0.36, size = 134, normalized size = 1.16 \[ \frac {b^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )\right ) \left (\cos ^{3}\left (f x +e \right )\right )}{6}-\frac {\sin \left (f x +e \right ) \left (\cos ^{3}\left (f x +e \right )\right )}{8}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{16}+\frac {f x}{16}+\frac {e}{16}\right )+2 a b \left (-\frac {\sin \left (f x +e \right ) \left (\cos ^{3}\left (f x +e \right )\right )}{4}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )+a^{2} \left (\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x)

[Out]

1/f*(b^2*(-1/6*sin(f*x+e)^3*cos(f*x+e)^3-1/8*sin(f*x+e)*cos(f*x+e)^3+1/16*sin(f*x+e)*cos(f*x+e)+1/16*f*x+1/16*
e)+2*a*b*(-1/4*sin(f*x+e)*cos(f*x+e)^3+1/8*sin(f*x+e)*cos(f*x+e)+1/8*f*x+1/8*e)+a^2*(1/2*sin(f*x+e)*cos(f*x+e)
+1/2*f*x+1/2*e))

________________________________________________________________________________________

maxima [A]  time = 0.49, size = 127, normalized size = 1.09 \[ \frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} {\left (f x + e\right )} + \frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{5} + 8 \, {\left (6 \, a^{2} - b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (8 \, a^{2} - 4 \, a b - b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{6} + 3 \, \tan \left (f x + e\right )^{4} + 3 \, \tan \left (f x + e\right )^{2} + 1}}{48 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/48*(3*(8*a^2 + 4*a*b + b^2)*(f*x + e) + (3*(8*a^2 + 4*a*b + b^2)*tan(f*x + e)^5 + 8*(6*a^2 - b^2)*tan(f*x +
e)^3 + 3*(8*a^2 - 4*a*b - b^2)*tan(f*x + e))/(tan(f*x + e)^6 + 3*tan(f*x + e)^4 + 3*tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 14.73, size = 120, normalized size = 1.03 \[ x\,\left (\frac {a^2}{2}+\frac {a\,b}{4}+\frac {b^2}{16}\right )+\frac {\left (\frac {a^2}{2}+\frac {a\,b}{4}+\frac {b^2}{16}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^5+\left (a^2-\frac {b^2}{6}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {a^2}{2}-\frac {a\,b}{4}-\frac {b^2}{16}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^6+3\,{\mathrm {tan}\left (e+f\,x\right )}^4+3\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(e + f*x)^2*(a + b*sin(e + f*x)^2)^2,x)

[Out]

x*((a*b)/4 + a^2/2 + b^2/16) + (tan(e + f*x)^3*(a^2 - b^2/6) - tan(e + f*x)*((a*b)/4 - a^2/2 + b^2/16) + tan(e
 + f*x)^5*((a*b)/4 + a^2/2 + b^2/16))/(f*(3*tan(e + f*x)^2 + 3*tan(e + f*x)^4 + tan(e + f*x)^6 + 1))

________________________________________________________________________________________

sympy [A]  time = 4.84, size = 314, normalized size = 2.71 \[ \begin {cases} \frac {a^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} x \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {a b x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {a b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a b x \cos ^{4}{\left (e + f x \right )}}{4} + \frac {a b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {a b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} + \frac {b^{2} x \sin ^{6}{\left (e + f x \right )}}{16} + \frac {3 b^{2} x \sin ^{4}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{16} + \frac {3 b^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{4}{\left (e + f x \right )}}{16} + \frac {b^{2} x \cos ^{6}{\left (e + f x \right )}}{16} + \frac {b^{2} \sin ^{5}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{16 f} - \frac {b^{2} \sin ^{3}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \sin {\left (e + f x \right )} \cos ^{5}{\left (e + f x \right )}}{16 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\relax (e )}\right )^{2} \cos ^{2}{\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**2*(a+b*sin(f*x+e)**2)**2,x)

[Out]

Piecewise((a**2*x*sin(e + f*x)**2/2 + a**2*x*cos(e + f*x)**2/2 + a**2*sin(e + f*x)*cos(e + f*x)/(2*f) + a*b*x*
sin(e + f*x)**4/4 + a*b*x*sin(e + f*x)**2*cos(e + f*x)**2/2 + a*b*x*cos(e + f*x)**4/4 + a*b*sin(e + f*x)**3*co
s(e + f*x)/(4*f) - a*b*sin(e + f*x)*cos(e + f*x)**3/(4*f) + b**2*x*sin(e + f*x)**6/16 + 3*b**2*x*sin(e + f*x)*
*4*cos(e + f*x)**2/16 + 3*b**2*x*sin(e + f*x)**2*cos(e + f*x)**4/16 + b**2*x*cos(e + f*x)**6/16 + b**2*sin(e +
 f*x)**5*cos(e + f*x)/(16*f) - b**2*sin(e + f*x)**3*cos(e + f*x)**3/(6*f) - b**2*sin(e + f*x)*cos(e + f*x)**5/
(16*f), Ne(f, 0)), (x*(a + b*sin(e)**2)**2*cos(e)**2, True))

________________________________________________________________________________________